import React, { FC } from "react";
import type { Child1Prop } from "@/components/CompWithProps/Child1";
import { Child1 } from "@/components/CompWithProps/Child1";
import styles from "./styles.module.scss";

interface CompPropsInterface {
  num: number;
  child1Prop: Child1Prop;
}

const CompWithProps: FC<CompPropsInterface & { children: JSX.Element }> = ({
  num,
  child1Prop,
  children,
}) => {
  return (
    <>
      <div className={styles.main}>
        <div>
          <h2>{num}</h2>
        </div>
        <div className={styles.comp1}>
          <Child1 {...child1Prop}></Child1>
        </div>

        <div>{children}</div>
      </div>
    </>
  );
};
export { CompWithProps };
export type {CompPropsInterface};

